<?php
$objRequest 	= $this->_request;
$strController 	= $objRequest->getControllerName();
$strAction 		= $objRequest->getActionName();
$AppUI			= Zend_Registry::get('AppUI');
$objCache		= Zend_Registry::get('objCache');
if($AppUI->id > 0) {
	$objAdmin 	= new Admin();
	$arrPerm	= $objAdmin->getPermissionByAdmin($AppUI->id);	
	foreach($arrPerm as $row) {
		$_SESSION[$row['code']] = $row['perm'];
	}
}
$strFileHeader	= ROOT_DIR . '/backend/controllers/common/' . $strController . '.header.php';
$strMessage		= ROOT_DIR . '/messages/backend/' . $strController . '.php';
if(file_exists($strFileHeader)) {
	include_once($strFileHeader);
}
if(file_exists($strMessage)) {
	include_once($strMessage);
}
$this->view->ROOT_DIR 		= ROOT_DIR;
$this->view->strController 	= $strController;
$this->view->strAction 		= $strAction;
$this->view->arrCSS 		= isset($arrCSS) ? $arrCSS : null;
$this->view->arrJSBefore 	= isset($arrJSBefore) ? $arrJSBefore : null;
$this->view->arrJS 			= isset($arrJS) ? $arrJS : null;
$this->view->arrError		= isset($arrError) ? $arrError : null;
$this->view->strMsg			= Vfriend_Function::getMsg();
$this->view->strError		= Vfriend_Function::getError();
$this->view->strBrowser		= Vfriend_Function::getBrowser();
?>